﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Dal;
using Watchdog.Bll;
using Watchdog.Bll.Base;

namespace Watchdog.Bll.Factory {

    public partial class ConfigFactory {
        public static void Delete ( ConfigBase config ) {
            DataClient.Current.ConfigDelete ( config.IntData );
        }

        public static List<Config> GetByDefinition ( int definition ) {
		    List<Config> outlist = new List<Config> ();
            Watchdog.Facade.Config[] list = Dal.DataClient.Current.ConfigGetByDefinition ( definition );
            foreach (Watchdog.Facade.Config item in list)
                outlist.Add ( new Config(item) );
            return outlist;
            // return DataClient.Current.ConfigGetByDefinition ( definition );
        }
        public static Config GetById ( int id ) {
            return new Config (DataClient.Current.ConfigGetById (id));
        }
				
        public static void Insert ( ConfigBase config ) {
            config.IntData = DataClient.Current.ConfigInsert ( config.IntData );
        }
		
        public static void Update ( ConfigBase config ) {
            DataClient.Current.ConfigUpdate ( config.IntData );
        }
		
	}
}
